export const debounceRef = (value: number | string, delay = 300) => {
  let timer: any
  return customRef((track, trigger) => {
    return {
      get() {
        track()
        return value
      },
      set(val) {
        clearTimeout(timer)
        timer = setTimeout(() => {
          trigger()
          value = val
        }, delay)
      }
    }
  })
}
